﻿#include "VertexShader.h"
#include "RenderObject.h"

/////////////////////////////////////////////////////
// UVertexShader

UVertexShader::UVertexShader(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{

}

FVertexToPixelInterpolants UVertexShader::RunVertexShader(const FRenderObjectVertex& Vertex)
{
	FVertexToPixelInterpolants Output;

	// 顶点着色器输出齐次裁剪空间的位置
	Output.Position = ShaderBuiltinVariables->Matrix_MVP.TransformPosition(Vertex.Position);
	Output.Color = Vertex.VertexColor;
	Output.UVs = Vertex.UVs;
	Output.Normal = Vertex.Normal;
	Output.Tangent = Vertex.Tangent;
	
	return Output;
}

/////////////////////////////////////////////////////
